<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import = "javax.servlet.http.HttpSession" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 5.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.css">
	
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<meta http-equiv="edit-Type" edit="text/html; charset=utf-8" />

<title>Register</title>
</head>
<body>
<% 
		String un = (String) session.getAttribute("name");
		if(un!=null){ %>
		
		<nav class="navbar navbar-default navbar-fixed-top " role="navigation">
		<div class="container-fluid">
		<div class="navbar-header">
		<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      
      </div>
   <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav navbar-right">
      <li class="active"><a href="AdminPanel.jsp">Home <span class="sr-only">(current)</span></a></li>
        <li><a href="LogOut">LogOut</a></li>
      </ul></div>
		</nav><br><br><br>
<div class="container">

    <div class="banner">
    <h2 class="text-center login-title" >EZRiceMillSystem</h2>
    	<div class="col-sm-2 col-md-4 col-md-offset-4">
	<h4 class="text-center login-title">Register here</h4>
	    	<div class="well">
    		 <div class="account-wall">
	<form  name="Registration form" action ="Register" method="post">
				<input type="text" name = "name" class="form-control" placeholder="Name" required autofocus><br>
				<input type="email" name = "email" class="form-control" placeholder="Email" required><br>
				<input type="text" name = "username" class="form-control" placeholder="UserName" required><br>
				<input type="text" name = "password" class="form-control" placeholder="Password" required><br>
				<button class="btn btn-lg btn-primary btn-block" type="submit">
				Register</button>
</form><%}
else{  
	out.println("<script type=\"text/javascript\">");
	   out.println("alert('Please login first');");
	   out.println("location='index.jsp';");
	   out.println("</script>");
			//out.print("Please login first");    
            //request.getRequestDispatcher("index.jsp").include(request, response);  
        } 
       %>
          </div>
         </div>
          </div>
           </div>
            </div>
             
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src = "bootstrap/js/bootstrap.js" type="text/javascript"> 


function stopRKey(evt) { 
  var evt = (evt) ? evt : ((event) ? event : null); 
  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); 
  if (evt.keyCode == 13)  {return false;} 
} 

document.onkeypress = stopRKey; 

</script>
</body>
</html>